This project highlights the association between PTSD symptoms and blood pressure variability, an important early marker of cardiovascular risk. Understanding these patterns can guide more targeted interventions to improve heart health in individuals experiencing chronic psychological stress.
---
title: "Chenyun Final Dashboard"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
source_code: embed
theme: flatly
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
library(flexdashboard)
library(dplyr)
library(ggplot2)
library(plotly)
library(DT)
```
```{r load-data}
# Load datasets
Lifepak_Stress <- read.csv("Lifepak_Stress.csv")
Lifepak_Sleep_2 <- read.csv("Lifepak_Sleep 2.csv")
# Merge datasets by participant and date
merged_data <- merge(Lifepak_Stress, Lifepak_Sleep_2, by = c("id_screening", "date"), all = TRUE)
# Create new variables: Pulse Pressure
merged_data <- merged_data %>%
mutate(
pulse_pressure_am = s_bp_am - d_bp_am,
pulse_pressure_pm = s_bp_pm - d_bp_pm
)
```
PTSD and Blood Pressure Results
=====================================
Column {data-width=350}
-------------------------------------
### PTSD Levels vs Morning Systolic BP
```{r widget1}
# Interactive Scatter Plot
scatter_plot <- ggplot(merged_data, aes(x = PCL5_q8, y = s_bp_am, color = s_bp_am,
text = paste("Participant ID:", id_screening,
"<br>PTSD Level:", PCL5_q8,
"<br>SBP (AM):", round(s_bp_am,1)))) +
geom_point(alpha = 0.7) +
geom_smooth(method = "lm", se = TRUE, color = "red", aes(group = 1)) +
labs(title = "PTSD Symptoms vs Morning Systolic Blood Pressure",
x = "PTSD Symptom Score (PCL5_q8)",
y = "Systolic BP (AM) (mmHg)") +
theme_minimal()
ggplotly(scatter_plot, tooltip = "text")
```
### Key Takeaways
- Slight positive trend between PTSD symptom score and morning systolic BP.
- Wide scatter suggests weak overall association.
Column {data-width=350}
-------------------------------------
### Participant Data Table
```{r widget2}
# Interactive Table
datatable(
merged_data %>%
select(id_screening, PCL5_q8, s_bp_am, d_bp_am, s_bp_pm, d_bp_pm),
options = list(pageLength = 8, searchHighlight = TRUE, scrollX = TRUE),
rownames = FALSE
)
```
### Key Takeaways
- Displays PTSD symptoms and BP readings for participants.
- Allows easy search and sorting of participant data.
Project Impact and GitHub Link
======================================
### Real-World Importance
This project highlights the association between PTSD symptoms and blood pressure variability, an important early marker of cardiovascular risk. Understanding these patterns can guide more targeted interventions to improve heart health in individuals experiencing chronic psychological stress.
### GitHub Pages Link
https://github.com/Shicy621/final-dashboard
Data Source
======================================
### Data Source Description
- **Datasets**: Lifepak_Stress and Lifepak_Sleep 2 datasets.
- **Source**: Internal app-based study (confidential).
- **Sample Size**: ~300 participants.
- **Collection Method**: Self-reported survey + wearable devices.
- **Collection Period**: 2022-2023.